/**
 * 节流函数编写
 */
const throttle = {
    inserted: function (el, binding) {
        let flag = true
        el.addEventListener('click', () => {
            console.log('前')
            if (!flag) {
                return
            }
            console.log('后')

            flag = false
            setTimeout(() => {
                binding.value()
                flag = true
            }, 3000)
        })
    },
}

export default throttle